//
//  WZPEssenceController.m
//  WZPItem
//
//  Created by 王王喆平 on 16/7/3.
//  Copyright © 2016年 UI. All rights reserved.
//

#import "WZPEssenceController.h"
#import "WZPAllViewController.h"
#import "WZPVideoViewController.h"
#import "WZPVoiceViewController.h"
#import "WZPPictureViewController.h"
#import "WZPTextViewController.h"

@interface WZPEssenceController ()


@end

@implementation WZPEssenceController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // 添加导航条
    [self setNavigation];
   
    // 添加子控制器
    [self setUpAllChileVeiwController];
    
    // 取消额外的滚动区域
    self.automaticallyAdjustsScrollViewInsets = NO;
}

// 添加子控制器
-(void)setUpAllChileVeiwController{
    
    WZPAllViewController * allView = [[WZPAllViewController alloc]init];
    allView.title = @"全部";
    [self addChildViewController:allView];
    
    WZPVideoViewController * videoView = [[WZPVideoViewController alloc]init];
    videoView.title = @"视频";
    [self addChildViewController:videoView];
    
    WZPVoiceViewController * voiceView = [[WZPVoiceViewController alloc]init];
    voiceView.title = @"声音";
    [self addChildViewController:voiceView];
    
    WZPPictureViewController *pictureView = [[WZPPictureViewController alloc]init];
    pictureView.title = @"图片";
    [self addChildViewController:pictureView];
    
    WZPTextViewController * textView = [[WZPTextViewController alloc]init];
    textView.title = @"段子";
    [self addChildViewController:textView];
    
}
// 设置导航条内容
-(void)setNavigation{
   // 设置导航条标题
    self.navigationItem.titleView =[[UIImageView alloc]initWithImage: [UIImage imageNamed:@"MainTitle"]];
   // 设置左右图形(按钮)
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"nav_item_game_icon"] hlightImage:[UIImage imageNamed:@"nav_item_game_click_icon"] target:self action:@selector(getlick)];
    self.navigationItem.rightBarButtonItem=[UIBarButtonItem itemWithImage:[UIImage imageNamed:@"navigationButtonRandom"] hlightImage:[UIImage imageNamed:@"navigationButtonRandomClick"] target:nil action:nil];
}
-(void)getlick{
    
    NSLog(@"点击了游戏");
}
@end
